package com.example.ppe_digicode;


import java.util.Calendar;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.DatePicker;
import android.widget.TextView;

public class AfficherDigicode extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_afficher_digicode);
        

        // Make sure we're running on Honeycomb or higher to use ActionBar APIs
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            // Show the Up button in the action bar.
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }

        
        Calendar date = Calendar.getInstance();
        int jour=date.get(Calendar.DAY_OF_MONTH);
        int mois=date.get(Calendar.MONTH)+1;
        int annee=date.get(Calendar.YEAR);
        
        String lejour=String.valueOf(jour);
        String lemois=String.valueOf(mois);
        String lannee=String.valueOf(annee);
        
        String ladate=lejour+"/"+lemois+"/"+lannee;
        
        
        // Create the text view
        TextView textView_date = new TextView(this);
         textView_date.setTextSize(30);
         textView_date.setText(ladate);
       
         DatePicker calendrier = new DatePicker(this);
        
         setContentView(calendrier);
         


        // Set the text view as the activity layout
        //setContentView(textView_date);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_afficher_digicode, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            NavUtils.navigateUpFromSameTask(this);
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

	

}
